// 频道

import request from '@/utils/request'
/**
 *获取频道
 */
export const getChannels = () => {
  return request({
    method: 'GET',
    url: '/app/v1_0/user/channels'
  })
}

/**
 * 获取所有频道
 */
export const getAllChannels = () => {
  return request({
    url: '/app/v1_0/channels',
    method: 'GET'
  })
}

/**
 * 添加频道
 * 不传推荐频道
 * channels :[{id:1,aeq:1}]
 */
export const addChannel = (channels) => {
  return request({
    url: '/app/v1_0/user/channels',
    method: 'PUT',
    data: {
      channels
    }
  })
}

/**
 * 删除频道
 * @param {*} channels [X,X,X]要删除频道的编号
 */
export const deleteChannel = (channels) => {
  return request({
    url: '/app/v1_0/user/channels',
    method: 'DELETE',
    data: {
      channels
    }
  })
}
